package com.as.server.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class LikeUser {
    long uid;
    List<Like> likeList= new ArrayList<>();

    public LikeUser(long uid) {
        this.uid = uid;
    }
    public LikeUser set(Long aid, int score) {
        this.likeList.add(new Like(aid, score));
        return this;
    }

    public Like find(long aid ) {
        for (Like like : likeList) {
            if (like.getAid()==aid) {
                return like;
            }
        }
        return null;
    }

}
